using <a href="https://openshift.redhat.com/community/blogs/free-apache-tomcat-hosting-in-the-cloud-for-java-applications-its-called-openshift">this article</a>
<ul>
	<li>Create an OpenShift account<ul>
		<li>Create it as a DIY account</li>
		<li>Add an PostgreSQL cartige</li>
	</ul></li>
	<li>Add the openshift git repo as remote repo and push to it</li>
	<li>Log on the the ssh</li>


	<li>Configure PostgreSQL:<ul>
		<li>Create the user:<br/>
		createuser -h $OPENSHIFT_POSTGRESQL_DB_HOST -p $OPENSHIFT_POSTGRESQL_DB_PORT -U $OPENSHIFT_POSTGRESQL_DB_USERNAME -D -R -S ilender -P
		<br/>and choose a password when prompted.</li>
		<li>Create the database:<br/>
		createdb -h $OPENSHIFT_POSTGRESQL_DB_HOST -p $OPENSHIFT_POSTGRESQL_DB_PORT -U $OPENSHIFT_POSTGRESQL_DB_USERNAME -O ilender -E utf-8 ilender</li>
		<li>Install the PL/pgSQL language on the PostgreSQL database:<br/>
		echo CREATE LANGUAGE plpgsql\; | psql ilender<br/>
		If it says 'language "plpgsql" already exists' just ignore it.</li>
	</ul></li>

	<li>cd app-root/data</li>
	<li>cp $OPENSHIFT_REPO_DIR/src/facebook-app.properties.template facebook-app.properties</li>
	<li>cp $OPENSHIFT_REPO_DIR/src/database.properties.template database.properties</li>
	<li>Edit facebook-app.properties to match the correct facebook application data</li>
	<li>Edit database.properties to match the correct database data.<ul>
		<li>Notice that database.url needs to begin with "jdbc:", and end with "ilender"</li>
		<li>You can't use environment variables inside java .properties file,
		so you need to translate $OPENSHIFT_POSTGRESQL_DB_HOST and $OPENSHIFT_POSTGRESQL_DB_PORT using the shell</li>
	</ul></li>

	<li>Install Tomcat:<ul>
		<li>cd ~/app-root/data</li>
		<!--<li>wget http://mirror.host4site.co.il/apache/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35.tar.gz</li>-->
		<li>wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35.tar.gz</li>
		<li>tar zxf apache-tomcat-7.0.35.tar.gz</li>
		<li>rm apache-tomcat-7.0.35.tar.gz</li>
		<li>ln apache-tomcat-7.0.35 tomcat -s</li>
	</ul></li>
	<li>Find the internal IP using "echo $OPENSHIFT_DIY_IP"</li>
	<li>Endit conf/server.xml in the apache tomcat folder:<ul>
		<li>Change &lt;Connector port="8080"... to have address=internal IP and redirectPort=15433</li>
		<li>Change &lt;Engine name="Catalina"... to have defaultHost=internal IP</li>
		<li>Change &lt;Host name="localhost"... to have name=the full domain name of the OpenShift website</li>
		<li>Change &lt;Server port="8005" shutdown="SHUTDOWN"&gt; to have port=15005 and address=internal IP</li>
		<li>Change &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&gt; to have port=15009 and address=internal IP</li>
	</ul></li>
	<li>Go to tomcat's webapps directory</li>
	<li>mv ROOT _admin</li>
	<li>ln -s $OPENSHIFT_REPO_DIR/app ROOT</li>
	<li>Start tomcat via bin/startup.sh</li>
</ul>

To update the site on OpenShift:
<ul>
	<li>Add your public key to the OpenShift application</li>
	<li>Add it as a remote(only do this once) using:<br/>
	git remote add openshift <i>open_shift_git_repo_url</i><br/>
	You can get <i>open_shift_git_repo_url</i> from the OpenShift application page.</li>
	<li>Now, every time you want to update the code on OpenShift, just use:<br/>
	git push openshift master<br/>
	Ofcourse, you can push other branches and tags to the OpenShift server as well. However:<ul>
		<li>Only the master branch should be pushed to the <i>test</i> OpenShift server-repo</li>
		<li>Only release tags should be pushed to the <i>app</i> OpenShift server-repo</li>
	</ul></li>
</ul>
